# 弹性ip-r入口地址

# 虚拟ip
vip_ip = '{{"vip-{vip_eip_uuid}-vip": {{'\
    '"Type": "ZStack::Resource::Vip",'\
    '"Properties": {'\
        '"name": "{vip_eip_name}",'\
        '"l3NetworkUuid": "{public_network_uuid}"'\
        '}}'\
    '}}'\
'}}'

# 弹性ip
eip_vip = '{{"eip-{vip_eip_uuid}": {{'\
    '"Type": "ZStack::Resource::Eip",'\
    '"Properties": {{'\
        '"name": "{vip_eip_name}",'\
        '"vipUuid": {{'\
            '"Fn::GetAtt": ['\
                '"vip-{vip_eip_uuid}-vip",'\
                '"uuid"'\
                ']'\
            '}}'\
        '}}'\
    '}}'\
'}}'

# 绑定到虚拟机
attach_eip = '{{"AttachEip-edge{eip_num}": {{'\
      '"Type": "ZStack::Action::AttachEip",'\
      '"Properties": {{'\
        '"vmNicUuid": {{'\
          '"Fn::GetAtt": ['\
            '{{'\
              '"Fn::Select": ['\
                '0,'\
                '{{'\
                  '"Fn::GetAtt": ['\
                    '"vm-5057105d-511b-47bf-b3a4-d1253e95e730",'\
                    '"vmNics"'\
                  ']'\
                '}}'\
              ']'\
            '}}',\
            '"uuid"'\
          ']'\
        '}},'\
        '"eipUuid": {{'\
          '"Fn::GetAtt": ['\
            '"eip-af109b0a-f6c2-4f92-bb04-9ebe64a3f42d",'\
            '"uuid"'\
          ']'\
        '}}'\
      '}}'\
    '}}'\
    '}}'